package org.example.carplatoon.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName(value = "carbind")
public class carBind implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long userId;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long carId;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long platoonId;

    private BigDecimal curLongitude;

    private BigDecimal curLatitude;

    private Long preCar;

    @TableField(fill = FieldFill.INSERT)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private LocalDateTime createTime;

    @TableField(exist = false)
    private String startPoint;

    @TableField(exist = false)
    private String endPoint;

    @TableField(exist = false)
    private BigDecimal platoonSpacing;

    @TableField(exist = false)
    private BigDecimal platoonSpeed;

    @TableField(exist = false)
    private LocalDateTime updateTime;
}
